(function($) {
    $.fn.objPowerOffRouter = function(InIt) {

        var xmlName = '';
        $("#Content").html(callProductHTML("html/router/PowerOff_router.html"));

        document.getElementById("title").innerHTML = jQuery.i18n.prop(InIt);
        lableLocaliztion(document.getElementsByTagName("label"));
        buttonLocaliztion("btPowerOffRouter");


        function _Reboot() {
            var xml = getData(xmlName);
            sm('PowerOffRouterModalBox', 319, 170);
            document.getElementById("h1PowerOffRouter").innerHTML = jQuery.i18n.prop("h1PowerOffRouter");
            document.getElementById("labelPowerOffRouter").innerHTML = jQuery.i18n.prop("labelPowerOffRouter");


            afterPowerOffRouterID = setInterval("afterReboot()", 50000);
        }

        function afterReboot() {
            hm();
            clearInterval(afterPowerOffRouterID);
            clearAuthheader();
        }

        this.setXMLName = function(_xmlname) {
            xmlName = _xmlname;
        }

        $("#btPowerOffRouter").click(function() {
            sm('PowerOffRouterBox', 360, 170);
            document.getElementById("btnPowerOffOK").innerHTML = jQuery.i18n.prop("btnPowerOffOK");
            document.getElementById("btnModalCancle").innerHTML = jQuery.i18n.prop("btnModalCancle");
            document.getElementById("h1PowerOffRouter").innerHTML = jQuery.i18n.prop("h1PowerOffRouter");
            document.getElementById("lQueryPowerOffRouter").innerHTML = jQuery.i18n.prop("lQueryPowerOffRouter");

            $("#btnPowerOffOK").click(function() {
                hm();
                _Reboot();
            });
        
        });

       
        return this;
    }
})(jQuery);


